/* 
 * File:   IRHandler.h
 * Author: Dylan
 *
 * Created on 15 juni 2012, 12:19
 */

#ifndef IRHANDLER_H
#define	IRHANDLER_H

#include "pRTOS.h"
#include "armboard.h"
#include "IR.h"
#include "IRListener.h"
#include "resources.h"

class IRHandler : public RTOS::task {
public:
    IRHandler(void) : 
    IRClock(this, 200 US),
    msTimer(this) {
    }
    void setListener(IRListener *irl) { listener = irl; }
private:
    RTOS::pool<struct IRSignal> IRPool;
    RTOS::clock IRClock;
    RTOS::timer msTimer;
    IR IRSensor;
    IRListener *listener;
    void main(void);
    void waiting(void);
    void receiving(void);
    void process(void); 
    void idle(void);
};



#endif	/* IRHANDLER_H */

